<!DOCTYPE html>
<html>
<head>
<meta charset="UTF-8">
<title>Injini WebKit</title>

<link rel="stylesheet" type="text/css" href="../css/core/ij.core.css" />
<link rel="stylesheet" type="text/css" href="../css/core/ij.display-object.css" />

<script type="text/javascript" src="http://code.jquery.com/jquery-1.7.1.js"></script>
<script type="text/javascript" src="../core/ij.core.js"></script>
<script type="text/javascript" src="../core/ij.array.js"></script>
<script type="text/javascript" src="../core/ij.object.js"></script>
<script type="text/javascript" src="../core/ij.event.js"></script>
<script type="text/javascript" src="../core/ij.observable.js"></script>
<script type="text/javascript" src="../core/ij.display-object.js"></script>
<script type="text/javascript" src="../core/ij.renderer.js"></script>
<script type="text/javascript" src="../core/ij.container.js"></script>
<script type="text/javascript" src="../core/ij.engine.js"></script>
<script type="text/javascript" src="../core/ij.viewport.js"></script>
<script type="text/javascript" src="../core/ij.layer.js"></script>
<script type="text/javascript" src="../core/ij.scene.js"></script>
<script type="text/javascript" src="../core/ij.animation-instruction.js"></script>
<script type="text/javascript" src="../core/ij.animation.js"></script>
<script type="text/javascript" src="../core/ij.animated-object.js"></script>
<script type="text/javascript" src="../core/ij.game-object.js"></script>
<script type="text/javascript" src="../core/ij.force.js"></script>
<script type="text/javascript" src="../core/ij.controls.js"></script>

<script type="text/javascript">
$(document).ready(function () {
	e = new ij.core.Engine();
	
	vp = new ij.core.Viewport();
	e.add(vp);
	vp.renderer.attach($('body'));
	
	sc = new ij.core.Scene();
	l = new ij.core.Layer();
	
	vp.add(sc);
	sc.add(l);
	
	sc.setSize(1000, 1000);
	l.setSize(1000, 1000);
	
	/*for (var i = 0; i < 100; i++) {
		var obj = new ij.core.AnimatedObject();
	    l.add(obj);
	    obj.moveTo(Math.round(Math.random() * 1000), Math.round(Math.random() * 1000));
	    obj.load('obj1.json');
	}*/
	
	gobj = new ij.core.GameObject();
    l.add(gobj);
    gobj.moveTo(10, 10);
    gobj.load('obj1.json');
    
    ground1 = new ij.core.GameObject();
    l.add(ground1);
    ground1.setSize(400, 100);
    ground1.moveTo(0, 200);
    ground1.setSprite({
    	color: "#f00"
    });
	
	$(document).bind('mousedown', function () {
		l.objects.each(function (i, obj) {
			obj.startAnimation('move');
		});
	}).bind('mouseup', function () {
		l.objects.each(function (i, obj) {
            obj.startAnimation('stand');
        });
    });
});
</script>
</head>
<body>

</body>
</html>